<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="B.html">去往B页面</a>
    <button id="btn1">上一页</button>
    <button id="btn2">下一页</button>
    <button id="btn3">上一页</button>
    <button id="btn4">下一页</button>
    <button id="btn5">刷新</button>
    <script>
        btn1.onclick = function(){
            window.history.back();
        }
        btn2.onclick = function(){
            window.history.forward();
        }
        btn3.onclick = function(){
            window.history.go(-1);
        }
        btn4.onclick = function(){
            window.history.go(1);
        }
        btn5.onclick = function(){
            window.history.go(0);
        }
    </script>
</body>
</html>